package com.twotiger.and.adapter;

import java.util.List;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import app.twotiger.p2p.R;

import com.twotiger.and.bean.Bank;

@SuppressLint("InflateParams")
public class Chargedetailadpter extends BaseAdapter {
    private List<Bank> banks;
    private LayoutInflater inflater;

    public Chargedetailadpter(Context context, List<Bank> banks) {
        super();
        this.banks = banks;
        inflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return banks.size();
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = inflater.inflate(R.layout.charge_detail_item, null);
        TextView item_text_1 = (TextView) view.findViewById(R.id.item_text_1);
        TextView item_text_2 = (TextView) view.findViewById(R.id.item_text_2);
        TextView item_text_3 = (TextView) view.findViewById(R.id.item_text_3);
        Bank bank = banks.get(position);
        item_text_1.setText(bank.getName());
        item_text_2.setText(bank.getPerAmt() + "万");
        item_text_3.setText(bank.getDayAmt() + "万");
        return view;
    }

}
